import random

from download.downloader import Downloader


def random_android():
    num = random.randint(1000, 9999)
    user_agent = 'Mozilla/5.0 (Linux; Android 6.0.1; MuMu Build/V417IR; wv) AppleWebKit/537.36 (KHTML, like Gecko) ' \
                 'Version/4.0 Chrome/52.0.{0}.100 Mobile Safari/537.36'.format(num)
    return user_agent


class smtDownloader(Downloader):
    def get_headers(self, task):
        cookie_data = 'JSESSIONID=FFC25722D55921465C4832F8E5A2B714;quickLogonKey=8d141a0bb6e84c348af5f05bcbe5102b$A1496087497E4E3F9840146634AD8506'
        # cookie_data = 'JSESSIONID=9A8EE71CAF4536AAE18EF14DE898AF93;quickLogonKey=06e47bd111334ef0930aa92378740dcb$83BAEF75EB630C73A4BA23DDD2177C84'
        # cookie_data = 'JSESSIONID=07C87CC691289568E938721EC1AC9DDE;quickLogonKey=19f7f9ddc97f4fc3af25658ec37f0255$1CC71EAF543F5FA412A028621F2752A6'
        # cookie_data = 'JSESSIONID=0F814105DFFB8F313214435925D30B29;quickLogonKey=a0b4edd50e1f4e8bb969b3e43b720caf$0EF9091D97C57990A0F8039804E6964D'
        # cookie_data = 'JSESSIONID=B661C3269E1859A05BBFBCBA04596EA7; JSESSIONID=BBDBC1271430AF697D1AB49D8AEE4240; quickLogonKey="6bb536992e1e4428b501664c352ba455$B67752AFC6C4DAC12B13328A0A4AB6C0"'
        return {'user-agent': random_android(), 'cookie': cookie_data, 'Connection': 'close'}
